package com.lins.framework.ui.home;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.lins.framework.R;
import com.lins.framework.common.base.BaseFragment;
import com.lins.framework.ui.home.appraise.AppraiseActivity;
import com.lins.framework.ui.home.date.DatePickerActivity;
import com.lins.framework.ui.home.download.DownloadActivity;
import com.lins.framework.ui.home.product.ProductListActivity;
import com.lins.framework.ui.home.rxbus.RxBusActivity;

import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Admin on 2017/6/19.
 */

public class HomeFragment extends BaseFragment {

    private Context context;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        ButterKnife.bind(this, getContentView());
        context = getContentView().getContext();
    }


    @OnClick({R.id.id_btn_product_list, R.id.id_btn_rxbus, R.id.id_btn_download, R.id.id_btn_appraise,
            R.id.id_btn_date})
    public void onClick(View view) {
        Intent intent = new Intent();
        switch (view.getId()) {
            case R.id.id_btn_product_list:
                intent.setClass(context, ProductListActivity.class);
                break;
            case R.id.id_btn_rxbus:
                intent.setClass(context, RxBusActivity.class);
                break;
            case R.id.id_btn_download:
                intent.setClass(context, DownloadActivity.class);
                break;
            case R.id.id_btn_appraise:
                intent.setClass(context, AppraiseActivity.class);
                break;
            case R.id.id_btn_date:
                intent.setClass(context, DatePickerActivity.class);
                break;
        }
        startActivity(intent);
    }
}
